-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(mobile): new sync #16556
base: main
Are you sure you want to change the base?
feat(mobile): new sync #16556
Conversation
Label error. Requires exactly 1 of: changelog:.*. Found: 📱mobile. A maintainer will add the required label. |
} | ||
|
||
Request? _getRequest(List<SyncRequestType> types) { | ||
final serverUrl = Store.tryGet(StoreKey.serverUrl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shenlong-tanwen I saw your note on not accessing the Store directly in the repo. How do you propose to access these values here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we can extend the ApiClient
from the generated open-api code and add a new method to return the response directly as a stream rather than a future. Then create a new class such as SyncMobileApi
and add it to the ApiService, which will pass our custom client to the api class.
Or to simplify it,
Api Service -> Custom Sync API (Custom API Client injected)
Sync Repo -> Depends on the Custom Sync API Class -> Api Service
import 'package:immich_mobile/infrastructure/repositories/sync_api.repository.dart'; | ||
import 'package:immich_mobile/repositories/user.repository.dart'; | ||
|
||
final syncStreamServiceProvider = Provider( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move the provider to providers/infrastructure/
), | ||
); | ||
|
||
class SyncApiRepository extends DatabaseRepository |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extend IsarDatabaseRepository
and make the class const
); | ||
break; | ||
default: | ||
debugPrint("[_parseSyncReponse] Unknown type $type"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer logs instead. We implicitly call debugPrint
on log calls during debug builds anyways. We can use finer or finest for logs like these.
No description provided.